/*
 * rowgage.h
 */

#ifndef ROWGAGE_H_
#define ROWGAGE_H_

/*
 * Initialize the ROWGAGE framework, initializing all enabled modules.
 */
int rgInit( int (*logic_init)(void), int *argc, char **argv );

/*
 * Enables ROWGAGE modules according to the given bit mask.
 */
void rgEnable( int mask );

/*
 * Disables ROWGAGE modules according to the given bit mask.
 */
void rgDisable( int mask );

/*
 * Adds the given function to the ROWGAGE turn callback list.
 * Every game turn all functions in the turn callback list will be called. The
 * order is not necessarily the order in which they were added.
 */
int rgAddTurnCallback( void (*function)(void) );

/*
 * Adds the given function to the ROWGAGE back callback list.
 * Every game turn when the turn arrays are swapped using rgCallbackSwap() all
 * functions in the back turn callback list will be called. The order is not
 * necessarily the order in which they were added.
 */
int rgAddBackCallback( void (*function)(void) );

/*
 * Resets the back turn callback list. It is recommended that this function is
 * called whenever the callback lists are about to be swapped to ensure only the
 * correct callbacks are in the list.
 */
int rgBackListReset();

/*
 * Swaps the callback lists.
 */
int rgCallbackSwap();

/*
 * Calls all the turn callbacks.
 */
void rgDoTurn();

/*
 * Sets the ROWGAGE keyboard callback to the given function.
 */
void rgSetKeyboardCallback( void (*f)(unsigned char key, int x, int y) );

#endif
